package com.hbxs.folder.util.validate;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author Radon Galleger
 * @ClassName: IdentityCardNumberValidator
 * @Package com.hbxs.util.validate
 * @Description: USEFULNESS()
 * @date 2020/5/13 18:29
 */
public class IdentityCardNumberValidator implements ConstraintValidator<IdentityCardNumber, Object> {

    @Override
    public void initialize(IdentityCardNumber identityCardNumber) {
    }

    @Override
    public boolean isValid(Object o, ConstraintValidatorContext constraintValidatorContext) {
        return IdCardValidatorUtils.isValidate18Idcard(o.toString());
    }
}
